<template>
	<view>
		<view class="h2">{{video.title}}</view>
		<!-- <video :enable-progress-gesture="false" :show-center-play-btn="true" :src="video.video_src" :poster="video.image_src" ></video> -->
		<!-- <yy-video-player 
		    :auto-play="false" 
		    :url="video.video_src"  
		    :poster="video.image_src" 
		    :show-back-btn="false"
			:process-bar-color="'white'"
			:show-download-btn="false"
		  ></yy-video-player> -->
		<xiaoVideoElement :src="video.video_src" :img="video.image_src"></xiaoVideoElement>
		<!-- <web-view :src="video.video_src" :update-title="false"></web-view> -->
		<!-- <view class="title">视频简介：</view>
		<view class="msg">{{video.des}}</view> -->
	</view>
</template>

<script>
	import {
		getQiyeVideoMessage
	} from "@/api/userminp.js"
	// import yyVideoPlayer from '@/components/yy-video-player/yy-video-player.nvue';
	import xiaoVideoElement from "../xiao-video-component/xiao-video-component.vue"
	export default {
		data() {
			return {
				// 视频信息
				video:null,
				// 播放按钮
				playback:false,
				// 播放控件
				playComponent:false,
				//  视频id
				id:null,
			}
		},
		components:{
			// yyVideoPlayer,
			xiaoVideoElement
		},
		onLoad(e){
			this.id = e.id
			if(e.share_uid){
				uni.setStorageSync("share_uid",e.share_uid)
			}
			getQiyeVideoMessage({
				id:e.id
			}).then(res=>{
				this.video=res.data 
			})
			// uni.showLoading({
			// 	title:"视频加载中...",
			// 	mask:true
			// })
			// uni.showToast({
			// 	title:"视频加载中...",
			// 	icon:"loading",
			// 	duration:1000*60
			// })
		},
		onShow(e){
		},
		onShareAppMessage(){
			return { // 自定义分享内容
				title: this.video.title,
				path: `/pages/webview/playVideo/playVideo?id=${this.id}&share_uid=${uni.getStorageSync("UID")}` 
			}
		},
		onShareTimeline(){
			return { // 自定义分享内容
				title: this.video.title,
				path: `/pages/webview/playVideo/playVideo?id=${this.id }&share_uid=${uni.getStorageSync("UID")}`
			}
		},
		methods: {
			// 视频加载完毕执行
			loaded(e){
				this.playback=true;
				this.playComponent=true;
				uni.hideToast();
				// uni.hideLoading()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.h2{
		font-size: 30rpx;
		font-weight: 800;
		text-align: center;
		margin:15rpx 0;
	}
	video{
		width: 100%;
	}
	.title{
		font-size: 35rpx;
		margin: 0 0 0 20rpx;
	}
	.msg{
		padding: 20rpx;
		text-indent: 70rpx;
		font-size: 30rpx;
		// font-size: 16rpx;
	}
</style>
